Microprogramming is a technique which has been in existence for more than thirty years as a method for designing and utilizing the control unit in a digital computer or other digital controller. (Hereinafter the term "digital computer" will be used by itself but should be understood to refer to and include other digitally controlled devices, as well.) In a digital computer, the control unit may also be referred to as the processor or central processing unit. The control unit is that portion of the system which directs all hardware activity within the system. For example, the control unit causes instructions to be fetched from memory, decodes the instructions to determine the operation to be performed, determines the source and destination of data, causes movement of data and the required operation to be performed, and then repeats the entire process until a halt operation is executed. In hard-wired, or conventional control, the logic of the control unit is physically wired in when the machine is built, using large arrays of gates, flip-flops and other devices. Such a hard-wired design is intended to be able to execute a fixed repertoire of "machine (or machine-level)" instructions in a predetermined manner.
Though the execution of a machine instruction requires interregister movement of data, the machine instruction does not care whether that data movement occurs alone or concurrently with other activity. It is therefore possible to define a lower level set of instructions, called microinstructions, which allow greater control over inter-register transfers of data. The execution of a machine-level instruction is obtained by executing an associated sequence of microinstructions; that sequence is frequently termed a microprogram.
A microprogram for each available machine-level instruction may be stored in a control memory, which is also called a control store, microprogram memory or microcode memory. To execute a specific machine instruction, the corresponding microprogram is executed. When the system is designed such that the user is permitted to write its own microprograms, the memory used for storing user-generated microprograms is often called a writable control store or alterable control memory. Microprogramming by the user allows him or her to develop new machine-level instructions (augmenting the manufacturer-supplied instruction set) and is often employed to allow one computer to accept software written using an instruction set intended for another computer. This is referred to as emulation.
Often, the microprogram memory in microprogrammable machines is divided into two parts: (1) read-only memory (ROM) which contains the microcode for executing the basic instruction set of the machine as specified by the manufacturer and (2) random-access memory (RAM) for the writable control store. Some microprogrammable microprocessors, referred to as bit-slice microprocessors, do not come with any predefined machine-level instruction set, leaving all higher level instructions to be developed from user-generated microinstructions.
A microprogrammable control mechanism of a computer system operates on a program sequencer and a variety of other objects, such as arithmetic and logic units, registers and control flip-flops. These various devices are referred to generically as "resources." For purposes of this discussion, the sequencer may be thought of as a resource even though it usually would be treated separately. Each microinstruction contains one or more bits to control each of the resources and control lines in the microprogrammed system, to effect the required operations and inter-register transfers. Thus the bits of a microinstruction may include data as well as commands. Microinstructions are therefore often quite large and may encompass fifty, sixty or more bits. When the bits in a microinstruction are applied to all the resources and the resources are clocked, one microinstruction is executed.
Machine instructions are performed by executing a microprogram--i.e., several microinstructions in a predetermined sequence. The address of such successive microinstruction is generated by the program sequencer. The sequencer, using the condition signals and instructions provided to it during each microinstruction, determines the next microcode address whose contents will be read. The microcode address is provided by the sequencer to the control memory, and a short time later (the memory's access time), the corresponding microinstruction appears at the outputs of the microprogram memory. Each microinstruction appears at the output of the microprogram memory at a predetermined edge of a clock signal.
In many systems and applications, speed of execution of microinstructions is of great concern. While numerous factors affect microinstruction execution time, one of the most important factors is microprogram memory access time, since microprogram memory access frequently consumes a substantial portion of the instruction cycle. To reduce such access time, faster microprogram memory may be used if the fastest microprogram memory is not already in use, but at the expense of additional cost: the cost of microprogram memory varies inversely with access time. That is, the faster the memory the more it will cost. Other improvements may be obtained by employing architectures which allow some operations to occur concurrently with other operations, rather than sequentially.
When a microprogram is being run, however, the constituent microinstructions must be executed in an intended, predetermined sequence until the completion of the entire microprogram, since the microprogram operates as a way of implementing a corresponding machine instruction. This limits the possibilities for concurrency. It is further important to allow sufficient time for each microinstruction to be executed before proceeding to the next microinstruction. These operating conditions are generally insured by not allowing the next microinstruction to be supplied to the system resources until the then current microinstruction has been completely executed. The separation between present instruction and next instruction is accomplished by placing a so-called "pipeline" register, or latch, on the output of the microprogram memory. The output state of the pipeline register is the present microinstruction even while its input terminals may be receiving the next microinstruction. As noted above, the output of the pipeline register is allowed to change to the next microinstruction only after the present microinstruction has been completely executed.
In some prior art systems, such as those that use the mode Am2900 microprocessor (slice) family from Advanced Micro Devices of Sunnyvale, Calif., a pipeline register on the output of the microprogram memory essentially splits the system into two parts: the data manipulation control bits go out to the system resources while a portion of the microinstruction is returned to the sequencer to determine the address of the next microinstruction to be executed. That address is sent to the microprogram memory and, after the memory access time elapses, the next microinstruction sits at the input of the pipeline register. Thus, while the resources are executing one instruction, the next instruction is being fetched from the microprogram memory. The presence of the pipeline register allows the microinstruction fetch to occur concurrently with at least part of the data operation, rather than serially.
However, on at least some of the system resources, the execution of a microinstruction is not an atomic operation; it itself involves an internal sequence of steps or events. Some of these events are preliminary operations which "set up" conditions required before other steps can occur; these "set-up" steps may, for example, be trivial operations such as waiting for data or signals to propagate to destination points. That is, time may be required for the values of operands at data inputs of the resource to propagate to appropriate locations within the resource, or to cause certain actions to occur within the resource before the instruction can be executed. Thus, the resource cannot perform its ultimate operations until the set-up conditions have been satisfied. The prior art systems therefore do not even begin to execute one microinstruction until the previous microinstruction has been fully executed.
The prior art systems suffer at least one other inefficiency, as well. Regardless of the speed of the various resources, the pipeline register supplies the new instruction's bits to all of the resources at the same time. Thus, the faster resources may remain idle (and nonproductive) while the slower resources complete the instruction cycle. Moreover, the speed required of the microprogram memory is dictated (for a given instruction cycle time) by the slowest resource. The expense of a memory of given speed is required even though for most resources that speed is not needed or utilized.
Accordingly, it is an object of the present invention to provide a system wherein execution of a microinstruction may begin earlier than was previously possible.
Another object of the present invention is to provide a microprogrammed controller which reduces the delay caused by preliminary, set-up operations which must occur in resources before microinstruction execution, and to thereby decrease the duration of an instruction cycle.
A further object of this invention is to decrease instruction cycle time without requiring the use of a faster, more expensive microprogram memory.
Another object of the present invention is to permit the use of slower, and therefore less expensive, microprogram memory while not increasing, and possibly decreasing, instruction cycle time.
Yet another object of the invention is to permit the segmentation of the microprogram memory so that the speed of each segment can be matched to the speed of the appropriate resource.